<template>
  <div class="auth-container">
    <div class="auth-card">
      <h2 class="auth-title">用户注册</h2>
      <el-tabs v-model="activeTab">
        <el-tab-pane label="普通用户" name="user">
          <register-form :user-type="0" />
        </el-tab-pane>
        <el-tab-pane label="管理员" name="admin">
          <register-form :user-type="1" />
        </el-tab-pane>
      </el-tabs>
      
      <div class="auth-footer">
        <el-link type="primary" @click="goLogin">已有账号？立即登录</el-link>
        <div class="copyright">CSDN @加瓦程序设计师</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import RegisterForm from '@/components/RegisterForm.vue'

const router = useRouter()
const activeTab = ref('user')

const goLogin = () => {
  router.push('/login')
}
</script>

<style>
.el-tabs__item {
  font-size: 16px;
  padding: 0 30px;
}
</style>